﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls
{
    /// <summary>
    /// CustomWebBrowserCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class CustomWebBrowserCtrl : UserControl
    {

        #region Variables

        #endregion

        #region Constructor

        public CustomWebBrowserCtrl()
        {
            InitializeComponent();
            //_web.BrowserSettings.Javascript = CefState.Enabled;

            this.Loaded += CustomWebBrowserCtrl_Loaded;
        }

        #endregion

        #region Properties



        #endregion

        #region 依赖属性


        public string Address
        {
            get { return (string)GetValue(AddressProperty); }
            set { SetValue(AddressProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Address.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty AddressProperty =
            DependencyProperty.Register("Address", typeof(string), typeof(CustomWebBrowserCtrl), new PropertyMetadata(""));


        #endregion

        #region Event

        #endregion

        #region Private Methods

        #endregion

        #region Public/Protected Methods

        public void RegisterJsObject(string name, object objectToBind)
        {
            //BindingOptions b = new BindingOptions()
            //{
            //    CamelCaseJavascriptNames = false
            //};
            //_web.RegisterJsObject(name, objectToBind, b);
        }

        public void ExecuteScriptAsync(string methodName, params object[] args)
        {
            //_web.ExecuteScriptAsync(methodName, args);
        }

        #endregion

        #region EventHandlers

        private void CustomWebBrowserCtrl_Loaded(object sender, RoutedEventArgs e)
        {
            //SysMainWin.Instance.AllowsTransparency = false;
        }

        #endregion
    }
}
